/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.click.app.model;

import com.click.app.service.DistinctiveManager;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 *
 * @author orgale
 */
@Entity
@Table(name = "distinctives")
@NamedQueries({@NamedQuery(name = "Distinctive.findAll", query = "SELECT d FROM Distinctive d"),
    @NamedQuery(name = "Distinctive.findById", query = "SELECT d FROM Distinctive d WHERE d.id = :idDistinctive"),
    @NamedQuery(name = "Distinctive.findByName", query = "SELECT d FROM Distinctive d WHERE d.name = :name"),
    @NamedQuery(name = "Distinctive.findByValue", query = "SELECT d FROM Distinctive d WHERE d.value = :value")})
public class Distinctive extends BaseObject implements Serializable {

    private static final long serialVersionUID = 1L;
    private Long id;
    private String name;
    private String value;

    public Distinctive() { }

    public Distinctive(Long id) {
        this.id = id;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Basic(optional = false)
    @Column(unique = true, name = "id_distinctive")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "value")
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Distinctive)) {
            return false;
        }
        Distinctive other = (Distinctive) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE).append(this.getId()).append(this.name).append(this.value).toString();
        
    }
}
